package com.dfbz.service.impl;

import com.dfbz.dao.ArticleDao;
import com.dfbz.model.Article;
import com.dfbz.service.ArticleServlet;

import java.util.List;
import java.util.Map;

public class ArticleServletImp implements ArticleServlet {

    private ArticleDao articleDao = new ArticleDao(Article.class);


    @Override
    public Integer findAllArticleNum(String title) {
        return articleDao.findAllArticleNum(title);
    }

    @Override
    public List<Article> findAllArticle(String title, Integer starNum, Integer pageSize) {
        return articleDao.findAllArticle(title,starNum,pageSize);
    }

    @Override
    public Article getById(Integer i) {
        return articleDao.getById(i);
    }


    public void addBrowse(Integer articleId) {
        articleDao.addBrowse(articleId);
    }

    public Integer getFocusNum(int i) {
        return articleDao.getFocusNum(i);
    }

    public List<Map<String, Object>> findMyFocusUserFocusArticle(int i1, Long id) {
       return articleDao.findMyFocusUserFocusArticle(i1,id);
    }

    public void save(Article article) {
        articleDao.save(article);
    }

    public Integer getAllMyFocusArticleNum(Long id) {
        return articleDao.getAllMyFocusArticleNum(id);
    }

    public List<Map<String, Object>> getMyFocusArticle(Long id, int i, Integer pageSize) {
        return articleDao.getMyFocusArticle(id,i,pageSize);
    }
}
